<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2017/7/23
 * Time: 下午9:43
 */


function display_sourcecode($url)
{
    $lines = file($url);
    $output = "";
    foreach ($lines as $line_num => $line) {
        // loop thru each line and prepend line numbers
        $output .= "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "\n";
    }
    return $output;
}

$url = "https://zhangrxiang.coding.me";
$source = display_sourcecode($url);
echo $source;

